Skip to content

Stack switching validation#8467

Merged
tlively merged 1 commit intomainfrom
fix-resume-handler-validation
Mar 16, 2026
Merged

Stack switching validation#8467
tlively merged 1 commit intomainfrom
fix-resume-handler-validation

Conversation

@tlively
Copy link
Member

@tlively tlively commented Mar 13, 2026

Now that we want to fuzz stack switching against a real implementation in V8, add proper validation. Copy in the stack switching tests, commenting out parts we do not handle for other reasons, to test that the new validation logic is correct. Fix DAE2 and a couple of stack switching tests that were not actually valid to begin with.

Now that we want to fuzz stack switching against a real implementation in V8, add proper validation. Copy in the stack switching tests, commenting out parts we do not handle for other reasons, to test that the new validation logic is correct. Fix DAE2 and a couple of stack switching tests that were not actually valid to begin with.
@tlively tlively requested a review from kripken March 13, 2026 23:49
// and $ct_handler must be cont [t2_tag*] -> [sig.results]
// But we cannot check this here because we do not know what type the
// block named $label expects. Save the tag to check when we visit the
// block later.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could make all this simpler by pre-visiting blocks. But I guess we can consider that separately.

;; OPEN_WORLD: (tag $tag (type $none))
(tag $tag (type $none))
;; OPEN_WORLD: (tag $tag (type $2) (result i32))
(tag $tag (result i32))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this change? I don't see how the result is used below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because $cont above expects to receive an i32 parameter and $cont is created by a resume handler for $tag. Any location that suspends with $tag can only expect to receive back an i32 as the newly created continuation's parameter if $tag has an i32 result.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right... $cont does have an i32 here. A similar thing was called $cont-i32 above and I missed the different names meant the same things.

@kripken
Copy link
Member

kripken commented Mar 16, 2026

lgtm otherwise

@tlively
Copy link
Member Author

tlively commented Mar 16, 2026

I'm going to go through and manually check test coverage before landing because I don't trust the spec tests very far.

@tlively
Copy link
Member Author

tlively commented Mar 16, 2026

Indeed, there is lots of missing coverage. Will go ahead and land this and add more coverage upstream as a follow-up.

@tlively tlively merged commit 66c7166 into main Mar 16, 2026
17 checks passed
@tlively tlively deleted the fix-resume-handler-validation branch March 16, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants